package cn.dlc.com.rmi.config;

import java.rmi.Naming;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import cn.dlc.com.rmi.server.UserService;

@Configuration
public class AppConfig {

	@Bean
	public UserService userService() throws Exception{
		// 拿到这个远程调用对象
		UserService userService = (UserService)Naming.lookup("rmi://localhost:8888/UserService");
		return userService;
	}
}
